home *** CD-ROM | disk | FTP | other *** search
- ############################################################################
- # #
- # dbase4.rul -- Decode It! rule file for dBASE IV DBF files #
- # (dBASE is a registered trademark of Borland International) #
- # #
- # Please note: This rule file is provided as an example only. While #
- # every effort has been made to validate the information #
- # presented here, Axiom Innovations takes no responsibility #
- # for the integrity of the data that results from using #
- # this example. #
- # #
- ############################################################################
-
- # dBASE IV Header area
- RECORD Header
-
- # Bits 0-2: dBase version number
- # Bits 3-5: Reserved for SQL
- # Bits 6-7: Availability of a memo file
- XTINY Version
-
- # Year of last edit date
- TINY Year
-
- # Month of last edit date
- TINY Month
-
- # Day of last edit date
- TINY Day
-
- # Number of records in the database
- LONG Record_Number
-
- # Length of header area
- SHORT Header_Length
-
- # Record size in bytes
- SHORT Record_Size
-
- SHORT Reserved1
-
- # Aborted transaction
- XTINY Aborted_Xact
-
- # Contents encoded
- XTINY Encoded_Contents
-
- # Reserved for LAN use
- XTINY Reserved2 12
- (OMIT0) Header.Reserved2
-
- # Reserved
- XTINY Reserved3 4
- (OMIT0) Header.Reserved3
-
- END
-
-
- # Field definitions
- WHILE .OFFSET < Header.Header_Length
- RECORD Field -1
-
- # Field name, left justified, zero-filled
- WHILE Field.Name <> 13
- ASCII Name 11
- (OMIT0) Field.Name
-
- # CR is the End of Fields marker
- WHILE Field.Name <=> 13
- BREAK
-
- # Field type: C, N, L, D, F, or M
- ASCII Type
-
- XLONG Reserved1
-
- # Field length
- TINY Length
-
- # Number of decimals
- TINY Decimal_Digits
-
- XSHORT Reserved2
-
- # Work area ID
- XTINY Work_Id
-
- # Reserved
- TINY Reserved 11
- (OMIT0) Field.Reserved
-
- END
-
-
- WHILE .OFFSET < Header.Header_Length
- TINY unused -1
- (OMIT0) unused
-
- # Actual database
- RECORD DBASE4_Record Header.Record_Number
-
- # Deleted records contain an asterisk ('*') in first byte
- # Normal records contain a space in first byte
- ASCII Deleted_Flag
-
- ASCII Info -1
-
- END Header.Record_Size
-
-
- # End of file
- TINY EndOfFile
-
-
- EXIT
-
-